<?php
/** @var TbActiveForm $form */
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'blog-form',
    'enableClientValidation' => true,
    'htmlOptions' => array(
        'enctype' => 'multipart/form-data',
    ),
    'type' => 'horizontal',
        ));
?>

<?php echo $form->errorSummary($model) ?>

<h3 class="heading">Main content</h3>

<?php echo $form->textFieldRow($model, 'node_title', array('class' => 'input-xxlarge')) ?>

<?php echo $form->textFieldRow($model, 'node_alias', array('class' => 'input-xxlarge')) ?>
<?php if($model->node_type=='certification' || $model->node_type=='education'):?>
<?php echo $form->textAreaRow($model,'node_description', array('rows'=>6, 'class'=>'input-xxlarge'));?>
<?php endif;?>
<?php echo $form->hiddenField($model, 'node_type') ?>

<div class="control-group">

    <label class="control-label">Content</label>

    <div class="controls">

        <?php
        $this->widget('ext.tinymce.TinyMce', array(
            'model' => $model,
            'attribute' => 'node_content',
            // Optional config
            //'spellcheckerUrl' => array('tinyMce/spellchecker'),
            // or use yandex spell: http://api.yandex.ru/speller/doc/dg/tasks/how-to-spellcheck-tinymce.xml
            //'spellcheckerUrl' => 'http://speller.yandex.net/services/tinyspell',
            'fileManager' => array(
                'class' => 'ext.elFinder.TinyMceElFinder',
                'connectorRoute' => 'filemanager/connector',
            ),
            'htmlOptions' => array(
                'rows' => 6,
            )
        ));
        ?>

    </div>

</div>
<?php if($model->node_type=='certification' || $model->node_type=='education'):?>
<label class="control-label">Image</label>
<div class="controls">
    <?php echo CHtml::fileField('content_image') ?>
    <br/>
    <?php if ($model->node_images != NULL && $model->node_images != '') : ?>
    <img src="<?php echo CONTENT_URL . $model->node_images ?>" width="100" height="100" alt="featuredImage" />
    <?php endif; ?>
</div>
<br/>
<?php endif;?>
<?php /*
  <h3 class="heading">SEO Information <label class="help-block">Maximum 160 characters</label></h3>

  <?php echo $form->textFieldRow($model, 'meta_title', array('class' => 'input-xxlarge')) ?>
  <?php echo $form->textFieldRow($model, 'meta_keywords', array('class' => 'input-xxlarge')) ?>
  <?php echo $form->textAreaRow($model, 'meta_description', array('class' => 'input-xxlarge')) ?>
 */ ?>
<?php echo $form->dropDownListRow($model, 'node_status', Node::getSatusFilter()); ?>


<div class="form-actions">

    <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => 'Submit')); ?>

    <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'reset', 'label' => 'Reset')); ?>

</div>



<?php $this->endWidget(); ?>